#pragma once

#include <list>
#include "IEngineComponentCollection.h"
#include "IEngineComponent.h"
#include "EnginePointer.h"
#include "SystemCollection.h"
#include "EngineObject.h"
#include "ISerializable.h"
#include "ISerializerWriteContext.h"

using namespace std;

class EngineEntity : public ISerializable
{
public:
	EngineEntity();
	~EngineEntity(void);

	void addComponent(EnginePointer<IEngineComponent> component);
	IEngineComponentCollection::iterator ComponentsBegin();
	IEngineComponentCollection::iterator ComponentsEnd();
	void Serialize(EnginePointer<ISerializerWriteContext>& context, char* name);
	static EngineEntity* Deserialize(EnginePointer<ISerializerReadContext>& context);

	AUTO_SIZE;
private:
	EnginePointer<IEngineComponentCollection> components;
};
